home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 3: CDPD 3 / Almathera Ten on Ten - Disc 3: CDPD3.iso / scope / 151-175 / scopedisk165 / merge / merge.doc < prev    next >
Text File  |  1995-03-19  |  4KB  |  97 lines

  1.  
  2.                                    Merge
  3.                       Copyright © 1990 by Kevin Kelm
  4.                                 SHAREWARE $5
  5.  
  6.  
  7. GENERAL
  8.  
  9.      Merge is a utility for all you programmers out there that want to
  10. integrate data files with your executables.  Merge even lets you chose to
  11. put the data into chip memory.
  12.  
  13.      If you find this program useful, please consider dropping $5 in the
  14. mail at the address below.
  15.  
  16. FORMAT
  17.  
  18.      The command-line form at of Merge is:
  19.  
  20. 1> Merge <program> <datafile> <outfile> <$LONG_ID> [CHIP]
  21.  
  22.      where...
  23.      <program>  is the filename of your program executable.
  24.      <datafile> is the filename of the data you want to include. This file
  25.                 will be included, VERBATIM.
  26.      <outfile>  is the output, executable filename.
  27.      <$LONG_ID> is any HEXADECIMAL longword identifier ... this is the long
  28.                 word that you will search the hunk table for... more on
  29.                 this later.  I typically use a value that I *know* will
  30.                 not be found at the beginning of any other hunk... 4B454C4D
  31.                 = "KELM".  This value ***MUST*** be unique!
  32.      [CHIP]     is an optional word that you may include to specify that
  33.                 you want the data to end up in CHIP memory.
  34.  
  35.  
  36. IMPLEMENTATION DETAILS
  37.  
  38.      Ok, now the fun.  Anybody out there using Benchmark Modula-2 is all
  39. set... all you need to do is call FindImageTable from the Images library
  40. module FindImages, and the ImageDescriptionTablePtr returned will be a
  41. pointer to your data hunk, rather than a pointer to an image description
  42. table.  More on this later (see step 4).
  43.  
  44.      For programmers using other systems, I can only make the following
  45. recomendations on how to find your data when the program is running.
  46.  
  47.      1) Get the address of the segment list for your process.  This CAN be
  48. more complex than it might seem.
  49.  
  50.      2) Scan through this list, looking for the first memory block that
  51. has as its first longword the <$LONG_ID> you are searching for.
  52.  
  53.      3) Once you find this value, you've found your data.  The longword
  54. immediately following the <$LONG_ID> will be a 1.  Ignore this; your data
  55. officially begins at beginning_of_hunk+8;
  56.  
  57.      4) The structure of your data is as follows:  The first longword
  58. represents the size, in bytes, of the data block.  The very next longword
  59. is the first longword of your data.
  60.  
  61.  
  62. SUMMARY
  63.  
  64.      Personally, I am somewhat wary of putting too much executable data in
  65. CHIP memory... past experience tells me that memory can get badly
  66. fragmented.  But this CAN be a useful feature; my first commercial video
  67. game contained all imagery for game play within the executable using just
  68. this technique.
  69.  
  70.      Well, enjoy!  I hope you get good use out of merge.  If for any
  71. bizarre reason you need to contact me, I can be reached as:
  72.  
  73. Kevin Kelm
  74. 7080 Roaring Springs Avenue
  75. Fountain, CO 80817
  76. (719)392-1023
  77.  
  78.      -or-
  79.  
  80. CIS: 71071,2726
  81.  
  82.      -or-
  83.  
  84. USENET: Try and catch me on comp.sys.amiga or comp.sys.amiga.tech !
  85.  
  86. Some of my other releases:
  87.  
  88.  T.A.C.L. The Adventure Construction Language       COMMERCIAL
  89.  T.A.C.L. Game demos                                Fred Fish 300
  90.  Boing! The Game                                    COMMERCIAL
  91.  Boing! The Game demo                               Fred Fish 337(?)
  92.  Super Echo 1.0                                     Fred Fish 300
  93.  TitleGen 1.6                                       Fred Fish 300
  94.  NeuralLab 1.0                                      ????
  95.  XenoZap virus killer                               ????
  96.  Visionary                                          Aegis, Nov. 1990
  97.